#ifndef GRAMMAR_H
#define GRAMMAR_H

#include <QList>
#include "production.h"
#include "shape.h"

//srednica markera
const double d=20.0;


class Grammar
{
public:

    Grammar()
    {
        Production p;


        p.clear();
        p.lshape=Shape("rMarker");
        p.rshape.positions.push_back(QPointF(0,0));
        Shape s("parter");
        s.uMarker.exist=true;
        s.uMarker.position=QPointF(s.image.width(),0);
        p.rshape.shapes.push_back(s);
        productions.push_back(p);

        p.clear();
        p.lshape=Shape("rMarker");
        p.rshape.positions.push_back(QPointF(0,0));
        s=Shape("asfalt");
        s.rMarker.exist=true;
        s.rMarker.position=QPointF(s.image.width(),-s.image.height());
        p.rshape.shapes.push_back(s);
        productions.push_back(p);

        p.clear();
        p.lshape=Shape("rMarker");
        p.rshape.positions.push_back(QPointF(0,0));
        s=Shape("drzewo");
        s.rMarker.exist=true;
        s.rMarker.position=QPointF(s.image.width(),-s.image.height());
        p.rshape.shapes.push_back(s);
        productions.push_back(p);


        p.clear();
        p.lshape=Shape("rMarker");
        p.rshape.positions.push_back(QPointF(0,0));
        s=Shape("parter");
        s.uMarker.exist=true;
        s.uMarker.position=QPointF(s.image.width(),0);
        s.rMarker.exist=true;
        s.rMarker.position=QPointF(s.image.width(),-s.image.height());
        p.rshape.shapes.push_back(s);
        productions.push_back(p);



        ///////////////////////////////////////



        p.clear();
        s=Shape("drzewo");
        s.rMarker.exist=true;
        s.rMarker.position=QPointF(s.image.width(),-s.image.height());
        p.lshape=s;
        s=Shape("drzewo");
        p.rshape.positions.push_back(QPointF(0,0));
        p.rshape.shapes.push_back(s);
        productions.push_back(p);

        p.clear();
        s=Shape("drzewo");
        s.rMarker.exist=true;
        s.rMarker.position=QPointF(s.image.width(),-s.image.height());
        p.lshape=s;
        s=Shape("drzewo");
        p.rshape.positions.push_back(QPointF(0,0));
        p.rshape.shapes.push_back(s);
        s=Shape("drzewo");
        s.rMarker.exist=true;
        s.rMarker.position=QPointF(s.image.width(),-s.image.height());
        p.rshape.positions.push_back(QPointF(s.image.width(),0));
        p.rshape.shapes.push_back(s);
        productions.push_back(p);


        p.clear();
        s=Shape("drzewo");
        s.rMarker.exist=true;
        s.rMarker.position=QPointF(s.image.width(),-s.image.height());
        p.lshape=s;
        s=Shape("drzewo");
        p.rshape.positions.push_back(QPointF(0,0));
        p.rshape.shapes.push_back(s);
        s=Shape("asfalt");
        s.rMarker.exist=true;
        s.rMarker.position=QPointF(s.image.width(),-s.image.height());
        p.rshape.positions.push_back(QPointF(s.image.width(),0));
        p.rshape.shapes.push_back(s);
        productions.push_back(p);


        p.clear();
        s=Shape("drzewo");
        s.rMarker.exist=true;
        s.rMarker.position=QPointF(s.image.width(),-s.image.height());
        p.lshape=s;
        s=Shape("drzewo");
        p.rshape.positions.push_back(QPointF(0,0));
        p.rshape.shapes.push_back(s);
        s=Shape("parter");
        s.rMarker.exist=true;
        s.rMarker.position=QPointF(s.image.width(),-s.image.height());
        s.uMarker.exist=true;
        s.uMarker.position=QPointF(s.image.width(),0);
        p.rshape.positions.push_back(QPointF(s.image.width(),0));
        p.rshape.shapes.push_back(s);
        productions.push_back(p);


        p.clear();
        s=Shape("drzewo");
        s.rMarker.exist=true;
        s.rMarker.position=QPointF(s.image.width(),-s.image.height());
        p.lshape=s;
        s=Shape("drzewo");
        p.rshape.positions.push_back(QPointF(0,0));
        p.rshape.shapes.push_back(s);
        s=Shape("parter");
        s.uMarker.exist=true;
        s.uMarker.position=QPointF(s.image.width(),0);
        p.rshape.positions.push_back(QPointF(s.image.width(),0));
        p.rshape.shapes.push_back(s);
        productions.push_back(p);



        /////////////////////////////////////////////////////////




        p.clear();
        s=Shape("asfalt");
        s.rMarker.exist=true;
        s.rMarker.position=QPointF(s.image.width(),-s.image.height());
        p.lshape=s;
        s=Shape("asfalt");
        p.rshape.positions.push_back(QPointF(0,0));
        p.rshape.shapes.push_back(s);
        productions.push_back(p);

        p.clear();
        s=Shape("asfalt");
        s.rMarker.exist=true;
        s.rMarker.position=QPointF(s.image.width(),-s.image.height());
        p.lshape=s;
        s=Shape("asfalt");
        p.rshape.positions.push_back(QPointF(0,0));
        p.rshape.shapes.push_back(s);
        s=Shape("asfalt");
        s.rMarker.exist=true;
        s.rMarker.position=QPointF(s.image.width(),-s.image.height());
        p.rshape.positions.push_back(QPointF(s.image.width(),0));
        p.rshape.shapes.push_back(s);
        productions.push_back(p);


        p.clear();
        s=Shape("asfalt");
        s.rMarker.exist=true;
        s.rMarker.position=QPointF(s.image.width(),-s.image.height());
        p.lshape=s;
        s=Shape("asfalt");
        p.rshape.positions.push_back(QPointF(0,0));
        p.rshape.shapes.push_back(s);
        s=Shape("drzewo");
        s.rMarker.exist=true;
        s.rMarker.position=QPointF(s.image.width(),-s.image.height());
        p.rshape.positions.push_back(QPointF(s.image.width(),0));
        p.rshape.shapes.push_back(s);
        productions.push_back(p);


        p.clear();
        s=Shape("asfalt");
        s.rMarker.exist=true;
        s.rMarker.position=QPointF(s.image.width(),-s.image.height());
        p.lshape=s;
        s=Shape("asfalt");
        p.rshape.positions.push_back(QPointF(0,0));
        p.rshape.shapes.push_back(s);
        s=Shape("parter");
        s.rMarker.exist=true;
        s.rMarker.position=QPointF(s.image.width(),-s.image.height());
        s.uMarker.exist=true;
        s.uMarker.position=QPointF(s.image.width(),0);
        p.rshape.positions.push_back(QPointF(s.image.width(),0));
        p.rshape.shapes.push_back(s);
        productions.push_back(p);


        p.clear();
        s=Shape("asfalt");
        s.rMarker.exist=true;
        s.rMarker.position=QPointF(s.image.width(),-s.image.height());
        p.lshape=s;
        s=Shape("asfalt");
        p.rshape.positions.push_back(QPointF(0,0));
        p.rshape.shapes.push_back(s);
        s=Shape("parter");
        s.uMarker.exist=true;
        s.uMarker.position=QPointF(s.image.width(),0);
        p.rshape.positions.push_back(QPointF(s.image.width(),0));
        p.rshape.shapes.push_back(s);
        productions.push_back(p);





        /***********************************************************************/

        p.clear();
        s=Shape("parter");
        s.rMarker.exist=true;
        s.rMarker.position=QPointF(s.image.width(),-s.image.height());
        p.lshape=s;
        s=Shape("parter");
        p.rshape.positions.push_back(QPointF(0,0));
        p.rshape.shapes.push_back(s);
        s=Shape("parter");
        s.rMarker.exist=true;
        s.rMarker.position=QPointF(s.image.width(),-s.image.height());
        s.uMarker.exist=true;
        s.uMarker.position=QPointF(s.image.width(),0);
        p.rshape.positions.push_back(QPointF(s.image.width(),0));
        p.rshape.shapes.push_back(s);
        productions.push_back(p);

        p.clear();
        s=Shape("parter");
        s.rMarker.exist=true;
        s.rMarker.position=QPointF(s.image.width(),-s.image.height());
        p.lshape=s;
        s=Shape("parter");
        p.rshape.positions.push_back(QPointF(0,0));
        p.rshape.shapes.push_back(s);
        s=Shape("parter");
        s.uMarker.exist=true;
        s.uMarker.position=QPointF(s.image.width(),0);
        p.rshape.positions.push_back(QPointF(s.image.width(),0));
        p.rshape.shapes.push_back(s);
        productions.push_back(p);

        p.clear();
        s=Shape("parter");
        s.rMarker.exist=true;
        s.rMarker.position=QPointF(s.image.width(),-s.image.height());
        p.lshape=s;
        s=Shape("parter");
        p.rshape.positions.push_back(QPointF(0,0));
        p.rshape.shapes.push_back(s);
        s=Shape("drzewo");
        s.rMarker.exist=true;
        s.rMarker.position=QPointF(s.image.width(),-s.image.height());
        p.rshape.positions.push_back(QPointF(s.image.width(),0));
        p.rshape.shapes.push_back(s);
        productions.push_back(p);

        p.clear();
        s=Shape("parter");
        s.rMarker.exist=true;
        s.rMarker.position=QPointF(s.image.width(),-s.image.height());
        p.lshape=s;
        s=Shape("parter");
        p.rshape.positions.push_back(QPointF(0,0));
        p.rshape.shapes.push_back(s);
        s=Shape("drzewo");
        p.rshape.positions.push_back(QPointF(s.image.width(),0));
        p.rshape.shapes.push_back(s);
        productions.push_back(p);

        p.clear();
        s=Shape("parter");
        s.rMarker.exist=true;
        s.rMarker.position=QPointF(s.image.width(),-s.image.height());
        p.lshape=s;
        s=Shape("parter");
        p.rshape.positions.push_back(QPointF(0,0));
        p.rshape.shapes.push_back(s);
        s=Shape("asfalt");
        s.rMarker.exist=true;
        s.rMarker.position=QPointF(s.image.width(),-s.image.height());
        p.rshape.positions.push_back(QPointF(s.image.width(),0));
        p.rshape.shapes.push_back(s);
        productions.push_back(p);

        p.clear();
        s=Shape("parter");
        s.rMarker.exist=true;
        s.rMarker.position=QPointF(s.image.width(),-s.image.height());
        p.lshape=s;
        s=Shape("parter");
        p.rshape.positions.push_back(QPointF(0,0));
        p.rshape.shapes.push_back(s);
        s=Shape("asfalt");
        p.rshape.positions.push_back(QPointF(s.image.width(),0));
        p.rshape.shapes.push_back(s);
        productions.push_back(p);

        p.clear();
        s=Shape("parter");
        s.rMarker.exist=true;
        s.rMarker.position=QPointF(s.image.width(),-s.image.height());
        p.lshape=s;
        s=Shape("parter");
        p.rshape.positions.push_back(QPointF(0,0));
        p.rshape.shapes.push_back(s);
        productions.push_back(p);


/////////////////////////////////
        p.clear();
        s=Shape("parter");
        s.rMarker.exist=true;
        s.rMarker.position=QPointF(s.image.width(),-s.image.height());
        s.uMarker.exist=true;
        s.uMarker.position=QPointF(s.image.width(),0);
        p.lshape=s;
        s=Shape("parter");
        s.uMarker.exist=true;
        s.uMarker.position=QPointF(s.image.width(),0);
        p.rshape.positions.push_back(QPointF(0,0));
        p.rshape.shapes.push_back(s);
        s=Shape("parter");
        s.rMarker.exist=true;
        s.rMarker.position=QPointF(s.image.width(),-s.image.height());
        s.uMarker.exist=true;
        s.uMarker.position=QPointF(s.image.width(),0);
        p.rshape.positions.push_back(QPointF(s.image.width(),0));
        p.rshape.shapes.push_back(s);
        productions.push_back(p);

        p.clear();
        s=Shape("parter");
        s.rMarker.exist=true;
        s.rMarker.position=QPointF(s.image.width(),-s.image.height());
        s.uMarker.exist=true;
        s.uMarker.position=QPointF(s.image.width(),0);
        p.lshape=s;
        s=Shape("parter");
        s.uMarker.exist=true;
        s.uMarker.position=QPointF(s.image.width(),0);
        p.rshape.positions.push_back(QPointF(0,0));
        p.rshape.shapes.push_back(s);
        s=Shape("parter");
        s.uMarker.exist=true;
        s.uMarker.position=QPointF(s.image.width(),0);
        p.rshape.positions.push_back(QPointF(s.image.width(),0));
        p.rshape.shapes.push_back(s);
        productions.push_back(p);

        p.clear();
        s=Shape("parter");
        s.uMarker.exist=true;
        s.uMarker.position=QPointF(s.image.width(),0);
        s.rMarker.exist=true;
        s.rMarker.position=QPointF(s.image.width(),-s.image.height());
        p.lshape=s;
        s=Shape("parter");
        s.uMarker.exist=true;
        s.uMarker.position=QPointF(s.image.width(),0);
        p.rshape.positions.push_back(QPointF(0,0));
        p.rshape.shapes.push_back(s);
        s=Shape("drzewo");
        s.rMarker.exist=true;
        s.rMarker.position=QPointF(s.image.width(),-s.image.height());
        p.rshape.positions.push_back(QPointF(s.image.width(),0));
        p.rshape.shapes.push_back(s);
        productions.push_back(p);

        p.clear();
        s=Shape("parter");
        s.uMarker.exist=true;
        s.uMarker.position=QPointF(s.image.width(),0);
        s.rMarker.exist=true;
        s.rMarker.position=QPointF(s.image.width(),-s.image.height());
        p.lshape=s;
        s=Shape("parter");
        s.uMarker.exist=true;
        s.uMarker.position=QPointF(s.image.width(),0);
        p.rshape.positions.push_back(QPointF(0,0));
        p.rshape.shapes.push_back(s);
        s=Shape("drzewo");
        p.rshape.positions.push_back(QPointF(s.image.width(),0));
        p.rshape.shapes.push_back(s);
        productions.push_back(p);

        p.clear();
        s=Shape("parter");
        s.uMarker.exist=true;
        s.uMarker.position=QPointF(s.image.width(),0);
        s.rMarker.exist=true;
        s.rMarker.position=QPointF(s.image.width(),-s.image.height());
        p.lshape=s;
        s=Shape("parter");
        s.uMarker.exist=true;
        s.uMarker.position=QPointF(s.image.width(),0);
        p.rshape.positions.push_back(QPointF(0,0));
        p.rshape.shapes.push_back(s);
        s=Shape("asfalt");
        s.rMarker.exist=true;
        s.rMarker.position=QPointF(s.image.width(),-s.image.height());
        p.rshape.positions.push_back(QPointF(s.image.width(),0));
        p.rshape.shapes.push_back(s);
        productions.push_back(p);

        p.clear();
        s=Shape("parter");
        s.uMarker.exist=true;
        s.uMarker.position=QPointF(s.image.width(),0);
        s.rMarker.exist=true;
        s.rMarker.position=QPointF(s.image.width(),-s.image.height());
        p.lshape=s;
        s=Shape("parter");
        s.uMarker.exist=true;
        s.uMarker.position=QPointF(s.image.width(),0);
        p.rshape.positions.push_back(QPointF(0,0));
        p.rshape.shapes.push_back(s);
        s=Shape("asfalt");
        p.rshape.positions.push_back(QPointF(s.image.width(),0));
        p.rshape.shapes.push_back(s);
        productions.push_back(p);

        p.clear();
        s=Shape("parter");
        s.uMarker.exist=true;
        s.uMarker.position=QPointF(s.image.width(),0);
        s.rMarker.exist=true;
        s.rMarker.position=QPointF(s.image.width(),-s.image.height());
        p.lshape=s;
        s=Shape("parter");
        s.uMarker.exist=true;
        s.uMarker.position=QPointF(s.image.width(),0);
        p.rshape.positions.push_back(QPointF(0,0));
        p.rshape.shapes.push_back(s);
        productions.push_back(p);


        ////


        p.clear();
        s=Shape("parter");
        s.rMarker.exist=true;
        s.rMarker.position=QPointF(s.image.width(),-s.image.height());
        s.uMarker.exist=true;
        s.uMarker.position=QPointF(s.image.width(),0);
        p.lshape=s;
        s=Shape("parter");
        s.rMarker.exist=true;
        s.rMarker.position=QPointF(s.image.width(),-s.image.height());
        p.rshape.positions.push_back(QPointF(0,0));
        p.rshape.shapes.push_back(s);
        s=Shape("pietro");
        s.uMarker.exist=true;
        s.uMarker.position=QPointF(s.image.width(),0);
        p.rshape.positions.push_back(QPointF(0,s.image.height()));
        p.rshape.shapes.push_back(s);
        productions.push_back(p);


        p.clear();
        s=Shape("parter");
        s.uMarker.exist=true;
        s.uMarker.position=QPointF(s.image.width(),0);
        p.lshape=s;
        s=Shape("parter");
        p.rshape.positions.push_back(QPointF(0,0));
        p.rshape.shapes.push_back(s);
        s=Shape("pietro");
        s.uMarker.exist=true;
        s.uMarker.position=QPointF(s.image.width(),0);
        p.rshape.positions.push_back(QPointF(0,s.image.height()));
        p.rshape.shapes.push_back(s);
        productions.push_back(p);

        p.clear();
        s=Shape("parter");
        s.rMarker.exist=true;
        s.rMarker.position=QPointF(s.image.width(),-s.image.height());
        s.uMarker.exist=true;
        s.uMarker.position=QPointF(s.image.width(),0);
        p.lshape=s;
        s=Shape("parter");
        s.rMarker.exist=true;
        s.rMarker.position=QPointF(s.image.width(),-s.image.height());
        p.rshape.positions.push_back(QPointF(0,0));
        p.rshape.shapes.push_back(s);
        s=Shape("dach");
        p.rshape.positions.push_back(QPointF(0,s.image.height()));
        p.rshape.shapes.push_back(s);
        productions.push_back(p);

        p.clear();
        s=Shape("parter");
        s.uMarker.exist=true;
        s.uMarker.position=QPointF(s.image.width(),0);
        p.lshape=s;
        s=Shape("parter");
        p.rshape.positions.push_back(QPointF(0,0));
        p.rshape.shapes.push_back(s);
        s=Shape("dach");
        p.rshape.positions.push_back(QPointF(0,s.image.height()));
        p.rshape.shapes.push_back(s);
        productions.push_back(p);


        p.clear();
        s=Shape("pietro");
        s.uMarker.exist=true;
        s.uMarker.position=QPointF(s.image.width(),0);
        p.lshape=s;
        s=Shape("pietro");
        p.rshape.positions.push_back(QPointF(0,0));
        p.rshape.shapes.push_back(s);
        s=Shape("dach");
        p.rshape.positions.push_back(QPointF(0,s.image.height()));
        p.rshape.shapes.push_back(s);
        productions.push_back(p);

        p.clear();
        s=Shape("pietro");
        s.uMarker.exist=true;
        s.uMarker.position=QPointF(s.image.width(),0);
        p.lshape=s;
        s=Shape("pietro");
        p.rshape.positions.push_back(QPointF(0,0));
        p.rshape.shapes.push_back(s);
        s=Shape("pietro");
        s.uMarker.exist=true;
        s.uMarker.position=QPointF(s.image.width(),0);
        p.rshape.positions.push_back(QPointF(0,s.image.height()));
        p.rshape.shapes.push_back(s);
        productions.push_back(p);


    };

   QList<Production> productions;



};


#endif // GRAMMAR_H
